---
import MainHead from '../../components/MainHead.astro';
import Nav from '../../components/Nav.astro';
import PostPreview from '../../components/PostPreview.astro';
import Pagination from '../../components/Pagination.astro';
import authorData from '../../data/authors.json';
export async function getStaticPaths({ paginate, rss }) {
const allPosts = await Astro.glob('../post/*.md');
const sortedPosts = allPosts.sort((a, b) => new Date(b.frontmatter.date).valueOf() - new Date(a.frontmatter.date).valueOf());
// Generate an RSS feed from this collection of posts.
// NOTE: This is disabled by default, since it requires `buildOptions.site` to be set in your "astro.config.mjs" file.
// rss({
// title: 'Don’s Blog',
// description: 'An example blog on Astro',
// customData: `en-us`,
// items: sortedPosts.map(item => ({
// title: item.title,
// description: item.description,
// link: item.url,
// pubDate: item.date,
// })),
// });
// Return a paginated collection of paths for all posts
return paginate(sortedPosts, { pageSize: 1 });
}
// page
let title = 'Don’s Blog';
let description = 'An example blog on Astro';
let canonicalURL = Astro.request.canonicalURL;
const { page } = Astro.props;
---
{title}
All Posts
{page.start + 1}–{page.end + 1} of {page.total}
{page.data.map((post) => )}
Unnamed repository; edit this file 'description' to name the repository.